import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import { store, key } from './store';

//全局注册自定义组件
import MyComponents from '@components/index'

// 路由拦截
import '@router/permissions'

import '@assets/iconfont/index.js'

import swiper from '@utils/swiper'

import ElementPlus from 'element-plus';
import 'element-plus/lib/theme-chalk/index.css';
import '@/theme/index.scss'

import '@https/axios'
import axios from '@https/api/index'
import {  AxiosInstance } from "axios";
//全局配置Axios
declare module '@vue/runtime-core' {
    interface ComponentCustomProperties {
      $axios: AxiosInstance;
    }
}

const app = createApp(App)
app.
use(router).
use(store, key).
use(swiper).
use(ElementPlus).
use(MyComponents).
mount('#app')

app.config.globalProperties.$axios = axios;

